package com.ruoyi.checksystem.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.checksystem.mapper.PopupDetailsMapper;
import com.ruoyi.checksystem.domain.PopupDetails;
import com.ruoyi.checksystem.service.IPopupDetailsService;

/**
 * 广告Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-19
 */
@Service
public class PopupDetailsServiceImpl implements IPopupDetailsService 
{
    @Autowired
    private PopupDetailsMapper popupDetailsMapper;

    /**
     * 查询广告
     * 
     * @param id 广告主键
     * @return 广告
     */
    @Override
    public PopupDetails selectPopupDetailsById(Long id)
    {
        return popupDetailsMapper.selectPopupDetailsById(id);
    }

    /**
     * 查询广告列表
     * 
     * @param popupDetails 广告
     * @return 广告
     */
    @Override
    public List<PopupDetails> selectPopupDetailsList(PopupDetails popupDetails)
    {
        return popupDetailsMapper.selectPopupDetailsList(popupDetails);
    }

    /**
     * 新增广告
     * 
     * @param popupDetails 广告
     * @return 结果
     */
    @Override
    public int insertPopupDetails(PopupDetails popupDetails)
    {
        popupDetails.setCreateTime(DateUtils.getNowDate());
        return popupDetailsMapper.insertPopupDetails(popupDetails);
    }

    /**
     * 修改广告
     * 
     * @param popupDetails 广告
     * @return 结果
     */
    @Override
    public int updatePopupDetails(PopupDetails popupDetails)
    {
        popupDetails.setUpdateTime(DateUtils.getNowDate());
        return popupDetailsMapper.updatePopupDetails(popupDetails);
    }

    /**
     * 批量删除广告
     * 
     * @param ids 需要删除的广告主键
     * @return 结果
     */
    @Override
    public int deletePopupDetailsByIds(Long[] ids)
    {
        return popupDetailsMapper.deletePopupDetailsByIds(ids);
    }

    /**
     * 删除广告信息
     * 
     * @param id 广告主键
     * @return 结果
     */
    @Override
    public int deletePopupDetailsById(Long id)
    {
        return popupDetailsMapper.deletePopupDetailsById(id);
    }
}
